<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <div id="test" data-name="张三" data-age="18">2323</div>
  <script>
    console.log(document.getElementById("test").dataset.name)
    console.log(document.getElementById("test").dataset.age)
  </script>
</body>
</html>